All Questions
61 questions
0votes
1answer
90views
How to return JSON result in controller
I would like to return JSON result in my controller. In my controller, I am getting an array of GUID and passing that to the CheckRecords method. Currently, I am not sure how to get the data back from ...
0votes
1answer
507views
Data fields are undefined in ASP.Net Core MVC using JSON
So, I have an issue with my Javascript code. I am using cascading dropdowns, one is for the car brand and another one for the car model. According to logic, when I choose one of the brands from the ...
-1votes
2answers
600views
Trouble sending JSON data to another action in asp.net MVC controller
I have this controller action: [HttpPost] public ActionResult OrderData(Order order) { var result = new { redirectToUrl = Url.Action("SeatSelection", "Orders&...
0votes
2answers
82views
Not getting the LINQ join query result in Ajax success method from Json Result using MVC however the result is shown correctly
I am trying to pass LINQ join query result(joining three tables ) from the controller to Ajax success function from Json Result but I am not getting any value means success function did not run and it ...
1vote
1answer
1kviews
Sending JSON from View to Controller ASP.NET MVC gives null values
I have a problem with sending JSON data from MVC View to Controller, all I get to Controller is: where my JSON I send in Url.Action looks like this: (I create it by my own adding array to array by ....
0votes
1answer
124views
How Controller convert JSON data from AJAX to Model instance?
Just out of curiosity. I observed that when I make POST method in AJAX. I always mention datatype:'json' and it actually works with my model instance in parameter in Controller - The URL path ...
0votes
1answer
403views
Controller.Json() returns null
I'm only using ASP.Net and MVC, no other libraries. The code is the following: //ExpensesController.cs - the controller public IActionResult getExpenses() { List<ExpensesViewModel> list = ...
0votes
1answer
54views
Pass JsonData from view and receive JSON return value in view
I'm trying to send data by user input to controller using ajax and want to execute query by user input. Later I want to return the query result to same view by a JsonResult. I have successfully sent ...
0votes
1answer
440views
How to get value from JSON object in c#? If the key is not defined [duplicate]
Below is my JSON information where you can notice that there is not any key defined. {"KOA": {"test.jpg": "xyz.com/images/test.jpg"}} I am Looking the Output like: ...
1vote
1answer
1kviews
How to return json object and view tgt from mvc controller
I am doing an MVC application where i need to pass json object from controller to view. public ActionResult VisualizeResult(int? id) { using (var context = new DBQUIZEntities()) ...
2votes
1answer
1kviews
Custom Validation Attribute not validating on Model - WebAPI C# and JSON
I have created a Model and a custom validation attribute to ensure that the value is greater than zero. The issue that I'm having is that the constructor of the custom attribute is hit, but the ...
0votes
2answers
918views
ASP.NET Core -- Upload .json file and convert to List<T>
So I managed to export a .json file by serializing my List. Now i'm trying to upload a .json file and desearialize it and add it back to my list. The idea is to be able to click on import, choose a ...
0votes
1answer
101views
JSON: Controller parameter value has slash appended in its value
I am working on a simple project and want to send the JSON data to Controller Here is my code: var emailId = JSON.stringify(response.emails.account); // get email ID $.ajax({ url: "/Home/...
1vote
0answers
1kviews
Sending Large JSON object string by ajax post
I have an MVC project and I'm trying to send a JSON object that has a large string in it to my controller. My ajax call fails instantly, not even getting to the controller, and gives me a 500 error. ...
1vote
3answers
391views
MVC Ajax: How to send string from view to controller
I've found a small problem in sending just plain text(string) via ajax compared to sending an json object. I have currently this setup working (cs)html <label for="search"> <i class="fa ...